cmake_minimum_required(VERSION 3.10)  
  
# 设置项目名称和版本  
project(LibLuLu VERSION 1.0.0)  
  
# 设置C++标准  
set(CMAKE_CXX_STANDARD 11)  
set(CMAKE_CXX_STANDARD_REQUIRED True)  
  
# 启用外部项目支持  
enable_language(ExternalProject)
  
# 定义外部项目依赖项  
set(EXTERNAL_DEPENDENCIES)  
  
# LibLuLu的依赖项  
list(APPEND EXTERNAL_DEPENDENCIES protobuf onnx OnnxRuntime onednn onetbb)  
  
# 逐个编译外部依赖项  
foreach(DEPENDENCY ${EXTERNAL_DEPENDENCIES})  
    # 下载并编译依赖项  
    ExternalProject_Add(${DEPENDENCY}  
        GIT_REPOSITORY "https://example.com/${DEPENDENCY}.git"  # 替换为实际的Git仓库地址  
        GIT_TAG "v1.0.0"  # 替换为实际的标签或提交哈希值  
        CMAKE_ARGS -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_CXX_STANDARD_REQUIRED=True  
    )  
endforeach()  
  
# 添加LibLuLu的源代码文件  
add_executable(LibLuLu main.cpp)  
target_link_libraries(LibLuLu PUBLIC ${EXTERNAL_DEPENDENCIES})